<?xml version="1.0" encoding="utf-8" ?> 
<sqlMap namespace="OrderDetailOther"
	xmlns="http://ibatis.apache.org/mapping" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<alias>
		<typeAlias alias="OrderDetailOther" type="Domain.OrderDetailOther" />
	</alias>

	<resultMaps>
		<resultMap id="FullResultMap" class="OrderDetailOther">
			<result property="id" column="id" dbType="Int"/>
			<result property="orderId" column="orderId" dbType="Int"/>
			<result property="name" column="name" dbType="NVarChar"/>
			<result property="guige" column="guige" dbType="NVarChar"/>
			<result property="shuliang" column="shuliang" dbType="Int"/>
			<result property="guige1" column="guige1" dbType="NVarChar"/>
			<result property="shuliang1" column="shuliang1" dbType="Int"/>
			<result property="jicai" column="jicai" dbType="NVarChar"/>
			<result property="yanse" column="yanse" dbType="NVarChar"/>
			<result property="dinggoushuliang" column="dinggoushuliang" dbType="Int"/>
      <result property="mupi" column="mupi" dbType="VarChar"/>
		</resultMap>
	</resultMaps>
	
	<statements>

		<select id="GetCount" resultClass="System.Int32">
			SELECT count(*) FROM [dbo].[orderDetailOther]
		</select>
		
		<select id="GetCountByCondition" parameterClass="Hashtable" resultClass="System.Int32" extends="GetCount">
			WHERE $condition$
		</select>
		
		<select id="FindAll" resultClass="OrderDetailOther">
			SELECT * 
			FROM [dbo].[orderDetailOther]
		</select>
		
		<select id="GetModel" parameterClass="OrderDetailOther" resultClass="OrderDetailOther" extends="FindAll">
			WHERE
				([orderDetailOther].[id] = #id,dbType=Int#)
		</select>

		<insert id="Insert" parameterClass="OrderDetailOther">
			INSERT INTO [dbo].[orderDetailOther] (
				
				[orderId] , 
				[name] , 
				[guige] , 
				[shuliang] , 
				[guige1] , 
				[shuliang1] , 
				[jicai] , 
				[yanse] , 
				[dinggoushuliang],
        [mupi]
			) VALUES (
				
				 #orderId,dbType=Int# , 
				 #name,dbType=NVarChar# , 
				 #guige,dbType=NVarChar# , 
				 #shuliang,dbType=Int# , 
				 #guige1,dbType=NVarChar# , 
				 #shuliang1,dbType=Int# , 
				 #jicai,dbType=NVarChar# , 
				 #yanse,dbType=NVarChar# , 
				 #dinggoushuliang,dbType=Int#,
         #mupi,dbType=NVarChar#
			)
		</insert>

		<update id="Update" parameterClass="OrderDetailOther">
			UPDATE [dbo].[orderDetailOther] SET
				 [orderId] = #orderId,dbType=Int#
				, [name] = #name,dbType=NVarChar#
				, [guige] = #guige,dbType=NVarChar#
				, [shuliang] = #shuliang,dbType=Int#
				, [guige1] = #guige1,dbType=NVarChar#
				, [shuliang1] = #shuliang1,dbType=Int#
				, [jicai] = #jicai,dbType=NVarChar#
				, [yanse] = #yanse,dbType=NVarChar#
				, [dinggoushuliang] = #dinggoushuliang,dbType=Int#
        , [mupi] = #mupi,dbType=NVarChar#
			WHERE
				([id] = #id,dbType=Int#)
		</update>

		<delete id="Delete" parameterClass="OrderDetailOther">
			DELETE FROM [dbo].[orderDetailOther]
			WHERE
				([id] = #id,dbType=Int#)
		</delete>

		<select id="GetModelsByCondition" parameterClass="Hashtable" resultClass="OrderDetailOther">
			SELECT $columnNames$ FROM [dbo].[orderDetailOther] where $condition$
		</select>
		
		<select id="GetModelsByConditionByPager" parameterClass="Hashtable" resultClass="OrderDetailOther">
			SELECT * FROM 
			(select $columnNames$,row_number() over(order by $orderBy$) as rno from [dbo].[orderDetailOther] where $condition$) t 
			<![CDATA[
			where t.rno>#startNo# and t.rno<=#endNo#
			]]>
		</select>
		
	</statements>
</sqlMap>
